home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
551-575
/
disk_572
/
wbstart
/
wbstart.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
4KB
|
109 lines
Documentation for WBStart V1.0 24.11.1991
This program is freely distributable, but copyrighted by me. This means that
you can copy it freely as long as you don't ask for any more money than a
nominal fee for copying. THIS APPLIES TO GERMAN PD DEALERS TOO!!! This program
may be put on PD disks, especially on Fred Fish's AmigaLibDisks. If you want to
distribute this program you MUST keep this document and the source code with
it. Program, document and source code must be distributed in their original
unmodified form. Of course you can use an archiver like LHarc to make it
available on mailboxes and FTP sites. This program cannot be used for
commercial purposes without written permission from the author. The author can
not be made responsible for any damage which is caused by using this program.
Send comments, suggestions or bug reports to:
Snail : Stefan Becker, Holsteinstrasse 9, 5100 Aachen, GERMANY
Domain: stefanb@cip-s01.informatik.rwth-aachen.de
FIDO : 2:242/7.6, Stefan_Becker@mowgli.fido.de
I. What does it do?
WBStart is a package to emulate the Workbench startup procedure. Emulating this
method is easy, because you only have to load a program, create a process for
it and then send a WB startup message to it. But this startup message is a
problem, because it contains memory and directory locks owned by your process
and it is only returned after the WB process ends. So you can't leave your
program until ALL WB processes you created have ended, or the replied messages
will go into nowhere land.
WBStart solves this problem by using a handler process, which does the starting
of the processes for you and then waits for the reply messages. You just send a
message to the handler port, containing all needed information like name and
parameters. The handler duplicates this information (so you can free your copy
without worry and leave your program) and then starts the process.
II. Installation & Usage
Just copy the file WBStart-Handler into your L: directory. Be sure to set the
execute flag on this file with
Protect L:WBStart-Handler +e
You can break WBStart-Handler by sending a CTRL-C to its process. If all WB
processes have returned, it will exit then.
WBStarter is an example program how to use the handler. It has the following
syntax:
WBStarter <command> [<command> ...]
WBStarter tries to start every command as WB process without parameters. The
file names must contain absolute paths, or the handler won't be able to find
the executables. If the handler is not running, WBStarter tries to start it.
III. How to use WBStart-Handler in your program
The handler opens a public message port named "WBStart-Handler Port". You must
send a message of the following type to this port:
struct WBStartMsg {
struct Message wbsm_Msg;
char *wbsm_Name;
BPTR wbsm_DirLock;
ULONG wbsm_Stack;
LONG wbsm_Prio;
ULONG wbsm_NumArgs;
struct WBArg *wbsm_ArgList;
};
wbsm_Msg
Standard message structure. You MUST initialize the mn_ReplyPort field to
your own message port.
wbsm_Name
Pointer to a string, which contains the name of the program. The handler
recognizes project icons and extracts the default tool.
wbsm_DirLock
Lock on a directory. wbsm_Name will be used relative to this directory.
wbsm_Stack
Stack size for the new process. Minimum is 4096 Bytes. If a tool icon exists,
then the stack size from the icon is used. When this message is replied, this
field contains a boolean, which indicates the success of the action.
wbsm_Prio
Priority of the new process. Must be in the range -128..127.
wbsm_NumArgs
Number of arguments in wbsm_ArgList. May be 0.
wbsm_ArgList
Pointer to an array of WB Arguments. These arguments contain lock on a
directory and a pointer to a file name, which is relative to the directory.
Look into <workbench/startup.h> for the definition of this data structure.
Look into the C source for WBStarter to find out the details.
IV. Compilation
This program was compiled with DICE, Matt Dillon's superb C compiler. Just
say "DMake" and it will produce the binary.
Stefan Becker